From 868e9704901562f7f1db663d309a7ec73b32b833 Mon Sep 17 00:00:00 2001 From: robertl Date: Wed, 18 Oct 2006 22:38:44 +0000 Subject: [PATCH] Let serial (and only serial) NMEA reader accept a 'bad' position, but mark it so that the consumer can know that it's bad. --- nmea.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nmea.c b/nmea.c index 012333f4b..fd18320dc 100644 --- a/nmea.c +++ b/nmea.c @@ -373,7 +373,12 @@ gpgga_parse(char *ibuf) &lngdeg,&lngdir, &fix,&nsats,&hdop,&alt,&altunits); - if (fix == 0) { + /* + * In serial mode, allow the fix with an invalid position through + * as serial units will often spit a remembered position up and + * that is more comfortable than nothing at all... + */ + if ((fix == 0) && (read_mode != rm_serial)) { return; } @@ -402,6 +407,9 @@ gpgga_parse(char *ibuf) waypt->hdop = hdop; switch (fix) { + case 0: + waypt->fix = fix_none; + break; case 1: waypt->fix = (nsats>3)?(fix_3d):(fix_2d); break; -- 2.30.2